Global Index
HTML5 JS API Index > Canvas Tutorials & Specs

DrawingStyle

Implements CanvasDrawingStyles.

Properties
DOMString
direction
The direction IDL attribute, on getting, must return the current value. On setting, if the value is one of ltr, rtl, or inherit, then the value must be changed to the new value. Otherwise, the new value must be ignored. When the object implementing the CanvasDrawingStyles interface is created, the direction attribute must initially have the value inherit.
DOMString
font
The font IDL attribute, on setting, must be parsed the same way as the 'font' property of CSS (but without supporting property-independent style sheet syntax like 'inherit'), and the resulting font must be assigned to the context, with the 'line-height' component forced to 'normal', with the 'font-size' component converted to CSS pixels, and with system fonts being computed to explicit values.
DOMString
lineCap
The lineCap attribute defines the type of endings that UAs will place on the end of lines. The three valid values are butt, round, and square.
unrestricted double
lineDashOffset
It is sometimes useful to change the "phase" of the dash pattern, e.g. to achieve a "marching ants" effect. The phase can be set using the lineDashOffset attribute. On getting, it must return the current value. On setting, infinite and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.
DOMString
lineJoin
The lineJoin attribute defines the type of corners that UAs will place where two lines meet. The three valid values are bevel, round, and miter.
unrestricted double
lineWidth
The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.
unrestricted double
miterLimit
When the lineJoin attribute has the value miter, strokes use the miter limit ratio to decide how to render joins. The miter limit ratio can be explicitly set using the miterLimit attribute. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value.
DOMString
textAlign
The textAlign IDL attribute, on getting, must return the current value. On setting, if the value is one of start, end, left, right, or center, then the value must be changed to the new value. Otherwise, the new value must be ignored. When the object implementing the CanvasDrawingStyles interface is created, the textAlign attribute must initially have the value start.
DOMString
textBaseline
The textBaseline IDL attribute, on getting, must return the current value. On setting, if the value is one of top, hanging, middle, alphabetic, ideographic, or bottom, then the value must be changed to the new value. Otherwise, the new value must be ignored.
Constructor
DrawingStyle(optional Element scope)
Operations
sequence<unrestricted double>
getLineDash()
When the getLineDash() method is invoked, it must return a sequence whose values are the values of the object's dash list, in the same order.
voidsetLineDash(sequence<unrestricted double> segments)